importPackage(edu.tsinghua.ddb.main);
importClass(edu.tsinghua.ddb.main.ScriptInterface);
var initiator = new ScriptInterface();

initiator.dropTable("Employee");
initiator.dropTable("Project");

initiator.createTable("Employee",
["Eid INTEGER",
"Ename VARCHAR",
"Eage INTEGER",
"Egender VARCHAR",
"Mid INTEGER"]);
initiator.makePrimaryKey("Employee","Eid");
initiator.hfrag("Employee",[
["Eid<10010000 and Egender='F'","site1"],
["Eid<10010000 and Egender='M'", "site2"],
["Eid>=10010000 and Egender='F'","site3"],
["Eid>=10010000 and Egender='M'","site4"]]);

initiator.createTable("Project",
["Pid INTEGER",
"Pname VARCHAR",
"Pbudget INTEGER",
"Plocation VARCHAR"]);
initiator.makePrimaryKey("Project","Pid");
initiator.vfrag("Project",[
["Pid Pname","site2"],
["Pid Pbudget Plocation","site4"]]);

